<template>
  <div class="sister-banner">
    <el-carousel :interval="5000" arrow="always" direction="vertical">
      <el-carousel-item v-for="(item, index) in banner" :key="index">
        <img class="sister-banner-img" :src="item.image" :alt="item.title">
        <span class="sister-banner-title">{{ item.title }}</span>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "SisterBanner",
  data() {
    return {
      title: "",
    };
  },
  computed: {
    ...mapState(["banner"]),
  },
  created() {
    this.$store.dispatch("getBanners");
  },
}
</script>

<style scoped lang="less">
.sister-banner {
  position: relative;
  width: 620px;
  height: 310px;
  & .sister-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  & .sister-banner-title {
    font-size: 20px;
    color: #FFFFFF;
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
  }
}
</style>